package week_8;

import java.util.Arrays;
import java.util.Iterator;

public class BigArrayHeapTest {
    public static void main(String[] args) {
        BigArrayHeap bigArrayHeap = new BigArrayHeap();
        int[] original = {36,30,18,40,32,45,22,50};
        System.out.print("初始的大顶堆为：" );
        for (Object a:original)
        {
            System.out.print(a+" ");
        }
        System.out.println();

        bigArrayHeap.addElement(36);
        bigArrayHeap.addElement(30);
        bigArrayHeap.addElement(18);
        bigArrayHeap.addElement(40);
        bigArrayHeap.addElement(32);
        bigArrayHeap.addElement(45);
        bigArrayHeap.addElement(22);
        bigArrayHeap.addElement(50);
        Iterator iterator = bigArrayHeap.iteratorLevelOrder();
        System.out.println("构造好的大顶堆序列（层序）");
        while(iterator.hasNext()){
            System.out.print(iterator.next() +" ");
        }
        System.out.println();

        bigArrayHeap.sort();


    }
}
